import {systemServer} from '../baseApi'

export class menuApi {
  static findPage (data) {
    return systemServer.connection('POST', '/sys/menu/findPage', data)
  }

  static save(data) {
    return systemServer.connection('POST', '/sys/menu/save', data)
  }

  static update(data) {
    return systemServer.connection('POST', '/sys/menu/update', data)
  }

  static delete(data) {
    return systemServer.connection('POST', '/sys/menu/delete',data)
  }

  static findMenuTree(data) {
    return systemServer.connection('GET', '/sys/menu/findMenuTree', data)
  }

  static findNavTree(data) {
    return systemServer.connection('POST', '/sys/menu/findNavTree', data)
  }

  static findChildrenMenuById(data) {
    return systemServer.connection('GET', '/sys/menu/findChildrenMenuById/' + data, data)
  }

  static findByName(data) {
    return systemServer.connection('GET', '/sys/menu/findByName', data)
  }
}
